﻿@page
@using LocalizeMessagesAndErrors
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model Example1.RazorPages.IndividualAccounts.Pages.AuthUsers.EditModel
@inject ISimpleLocalizer SimpleLocalizer

<h1>
    @SimpleLocalizer.LocalizeString("Edit", this)
</h1>

<h4>
    @SimpleLocalizer.LocalizeString("Edit the user's information", this)
</h4>
<hr />
<div class="row">
    <div class="col-md-8">
        <form method="post">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            @Html.Hidden("Data.UserId", Model.Data.UserId)
            <div class="form-group">
                <label asp-for="Data.Email" class="control-label">
                    @SimpleLocalizer.LocalizeString("Email", this)
                </label>
                <input asp-for="Data.Email" class="form-control" />
                <span asp-validation-for="Data.Email" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Data.UserName" class="control-label">
                    @SimpleLocalizer.LocalizeString("UserName", this)
                </label>
                <input asp-for="Data.UserName" class="form-control" />
                <span asp-validation-for="Data.UserName" class="text-danger"></span>
            </div>
            <div class="form-group row">
                <label asp-for="Data.Email" class="col-sm-2 control-label">
                    @SimpleLocalizer.LocalizeString("Roles", this)
                </label>
                <div class ="col-sm-10">
                    <select asp-for="Data.SelectedRoleNames" asp-items="Model.Data.RolesSelectList"></select>
                </div>
            </div>

            <div class="form-group">
                <input type="submit" value=@SimpleLocalizer.LocalizeString("Update", this)
                       class="btn btn-primary" />
                <a class="btn btn-secondary" asp-area="" asp-page=".\ListUsers">
                    @SimpleLocalizer.LocalizeString("Cancel", this)
                </a>
            </div>
        </form>
    </div>
</div>
